<?php
/* 
 * Copyright (c) 2018-2021   All rights reserved.
 * 
 * 创建时间：2021-05-16 09:31
 *
 * 项目：upload  -  $  - export.php
 *
 * 作者：liwei 
 */

?>

<div class="page page-formb">
    <div class="navbar page-admin-navbar adminbar navbar-bgcolor-red">
        <div class="navbar-inner">
            <div class="left">
                <a class="link tooltip-init" href="javascript:window.history.back();" data-tooltip="后退">
                    <svg class="icon" aria-hidden="true"><use xlink:href="#fa-back"></use></svg>
                </a>
                <a class="link tooltip-init" href="javascript:window.location.reload();" data-tooltip="刷新">
                    <svg class="icon" aria-hidden="true"><use xlink:href="#fa-refresh"></use></svg>
                </a>
            </div>
            <div class="title">
                <?php echo Lev::$app['title']?>
                <tips class="date" style="color:red !important;"><?php echo $tips?></tips>
            </div>
            <div class="right">
                <a class="button-fill button color-red scale8" href="<?php echo Lev::toCurrent(['r'=>'settings/export', 'ac'=>1, 'iden'=>$iden])?>">导出设置</a>
                <a class="button-fill button color-black scale8" href="<?php echo Lev::toCurrent(['r'=>'settings/export', 'ac'=>3, 'iden'=>$iden])?>">导出表单字段</a>
                <a class="button-fill button color-blue scale8" href="<?php echo Lev::toCurrent(['r'=>'settings/export', 'ac'=>2, 'iden'=>$iden])?>">导出表数据</a>
                <a class="button-fill button color-yellow" onclick="doExportSettings()">确定导出</a>
            </div>
        </div>
    </div>

    <div class="page-content">
        <div class="content-block" style="margin:0;text-align: left">
            <div class="card-header">
                <b>导出数据预览：</b>
                <tips>【提示】仅供预览，修改无效</tips>
            </div>
            <textarea style="width:100%;height:450px;font-size:12px"><?= is_array($settings) ? var_export($settings, true) : $settings; ?></textarea>
            <div class="card-footer">
                <a class="button-fill button wd220 color-yellow" onclick="doExportSettings()">确定导出</a>&nbsp;
            </div>
        </div>

    </div>
</div>
<script>
    function doExportSettings() {
        showIconLoader();
        jQuery.ajax({
            url:'',
            data: {dosubmit:1, inajax:1, _csrf:_csrf, _:Math.random()},
            dataType: 'json',
            type: 'post',
            success: function (data) {
                hideIconLoader();
                levtoast(data.message);
            },
            error: function (data) {
                hideIconLoader();
                errortips(data);
            }
        });
    }
</script>

